import {Component} from '@angular/core';
import {GnDigestUtils, GnForm} from "geminis-ng";

@Component({
  selector: 'gn-manage-administrator-edit',
  templateUrl: './administrator-edit.component.html'
})
export class AdministratorEditComponent extends GnForm {

  confirm(): void {
    GnDigestUtils.sha256(this.form.formGroup.value.password)
      .then(value => {
        this.form.formGroup.value.adminPassword = {};
        this.form.formGroup.value.adminPassword.password = value;
        this.form.formGroup.value.password = null;
        this.form.formGroup.value.passwordConfirm = null;
        this.dialog.confirmForm();
      });

  }

}
